package com.x.Part4_scanner;

import java.util.Scanner;

public class ScannerDemo {
    public static void main(String[] args) {
        //1、导包：idea会自动导包
        //2、new一个键盘扫描器对象
        Scanner sc = new Scanner(System.in);

        //使用nextInt()接收int类型
        int age = sc.nextInt();
        System.out.println("输入的年龄是" + age);

        //使用next()接收String类型
        String sex = sc.next();
        System.out.println("输入的性别是" + sex);
    }
}
